ci/ai: make git checkout work in the /investigate workflow#172001
Merged
Conversation
The /investigate agent reliably runs `git checkout <sha>` to inspect
the failure commit rather than the `checkout-sha` helper, despite the
prompt telling it not to. In the blobless clone that triggers a lazy
blob fetch which GitHub's promisor remote rejects ("not our ref") for
any commit not reachable from the default branch -- i.e. essentially
every failure SHA. The agent then gives up and analyzes master tip,
which is the persistent failure reported for the workflow.
Rather than depend on the agent obeying the instruction (it doesn't),
make the reflex command work. Install a `git` wrapper on PATH that
execs the real binary for everything and, for checkout/switch only,
retries after importing the target commit's snapshot when the lazy
fetch fails. The snapshot import is factored out of checkout-sha into
a shared snapshot-fetch helper. The prompt is updated to match: a
plain `git checkout <sha>` now works.
rudrakshsisodia
approved these changes
Jun 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The /investigate agent reliably runs
git checkout <sha>to inspect the failure commit rather than thecheckout-shahelper, despite the prompt telling it not to. In the blobless clone that triggers a lazy blob fetch which GitHub's promisor remote rejects ("not our ref") for any commit not reachable from the default branch -- i.e. essentially every failure SHA. The agent then gives up and analyzes master tip, which is the persistent failure reported for the workflow.Rather than depend on the agent obeying the instruction (it doesn't), make the reflex command work. Install a
gitwrapper on PATH that execs the real binary for everything and, for checkout/switch only, retries after importing the target commit's snapshot when the lazy fetch fails. The snapshot import is factored out of checkout-sha into a shared snapshot-fetch helper. The prompt is updated to match: a plaingit checkout <sha>now works.